import logging
from flask_script import Manager
from flask import session
from flask_script import Manager
from flask_migrate import Migrate,MigrateCommand
from info import create_app,db,models
"""
manger.py是程序启动的入口,只关心程序启动的参数和设置

"""
# 通过指定配置的名字创建对应的app
app=create_app("development")

manger = Manager(app)
# 将app和db进行关联
Migrate(app,db)
# 将迁移命令添加到manger中
manger.add_command("db",MigrateCommand)

@app.route('/')
def index():

    logging.debug("测试debug")
    session["name"] = "itheima"
    return 'index'

if __name__ == '__main__':
    manger.run()